package com.bit.store;

import java.util.ArrayList;
import java.util.List;

/**
 * bit-supper-ListMemoryStorage
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/10/11 下午 03:59
 */
public class ListMemoryStorage implements Storage {

    private List<String> data = new ArrayList();


    @Override
    public long getPosition() {
        return data.size();
    }

    @Override
    public String getAfter(int position) {
        if (data.size() > position + 1)
            return data.get(position + 1);
        return null;
    }

    @Override
    public void add(String data) {
        this.data.add(data);
    }


}

